module top(
           clk,
           rst,
           load,
           data, cout
       );
input clk, rst, load;
input [2: 0] data;
output reg [2: 0] cout;
always@(posedge clk)
	begin
		if (!rst)
			begin
				cout <= 3'b000;
			end
		else if (load)
			cout <= data;
		else if (cout >= 3'd6)
			cout <= 3'd0;
		else
			cout <= cout + 1'b1;
	end
endmodule
